<?php include("src/updateParameter_cs.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" media="all" href="includes/calendario/calendar-system.css" title="system" />
<script type="text/javascript" src="includes/calendario/calendar.js"></script>
<script type="text/javascript" src="includes/calendario/lang/calendar-es.js"></script>
<script type="text/javascript" src="includes/calendario/calendar-setup.js"></script>
<title>Actualizar Parametros :: ASSC</title>
<script language="javaScript" type="text/javascript" src="js/jquery.js"></script>
<script>J = jQuery.noConflict()</script>
<script language="javascript" type="text/javascript">

	
	function validateParameter()
	{ 
		var msg    = '';
		
		var param_salary  		= document.getElementById("param_salary").value;     
		var param_aporte      	= document.getElementById("param_aporte").value;
		var param_periodo      	= document.getElementById("param_periodo").value;
		var param_transporte      	= document.getElementById("param_transporte").value;
		var param_contribuciones      	= document.getElementById("param_contribuciones").value;

		if(param_salary == '') 
			msg= msg+'- Por favor entre salario. \n';
		if(param_aporte == '') 
			msg= msg+'- Por favor entre aporte. \n';
		if(param_periodo == '') 
			msg='- Por favor entre periodo. \n';
		if(param_transporte == '') 
			msg= msg+'- Por favor entre transporte. \n';
		if(param_contribuciones == '') 
			msg= msg+'- Por favor entre contribuciones. \n';
		
		if(msg=='')
		{
			document.getElementById('form').submit();
			return true;
		}
		else
		{
			alert(msg);
			return false;
		}		
	}
	

	function onlyNumbers(e)
	{
	   var key;
	   if(window.event)
		  key = window.event.keyCode;   //IE
	   else
		  key = e.which;                //firefox
	   if (!( (key >= 48 && key <= 57) || key ==8 || key ==9 || key ==0 || key ==46 ))
		  return false;
	   else
		  return true;
	}	

</script>
</head>
<body>
<?php $item_select = 11; include("menu.php");?><br />
 <form name="form" id="form" method="post" action="" enctype="multipart/form-data">
 <input type="hidden" name="edit" id="edit" value="1"/>	

    <div class="content_grv">
    	<table width="80%" align="center" class="shadow">
        	<tr>
            	<td class="title">Editar Parametros</td>
            </tr>
            <tr>
            	<td>
                	<table class="tbl_form" align="center">
                                    <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Salario: $</span></td>
                                        <td>&nbsp;</td>
                                        <td><input type="text" name="param_salary" id="param_salary" class="text_grv" size="21" maxlength="20" value="<?php echo $data->param_salary;?>"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Aporte: $</span></td>
                                        <td>&nbsp;</td>
                                        <td><input type="text" name="param_aporte" id="param_aporte" class="text_grv" size="21" maxlength="20" value="<?php echo $data->param_aporte;?>"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">IVA: $</span></td>
                                        <td>&nbsp;</td>
                                        <td><input type="text" name="param_iva" id="param_iva" class="text_grv" size="21" maxlength="20" value="<?php echo $data->param_iva;?>"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Periodo:</span></td>
                                        <td>&nbsp;</td>
                                        <td><input name="param_periodo" type="text" style="width:100px" readonly="readonly" id="param_periodo" maxlength="45" class="text_grv"
				value="<?php if(isset($data)) echo cambiarFormatoFecha($data->param_periodo,1)?>"/> 
			    <input name="imagea" type="image" id="calendar1" src="images/mostrar_calendario.png" align="absmiddle" width="18" height="16"/></td><script type="text/javascript">
						Calendar.setup({
						inputField : "param_periodo",							
						ifFormat : "%d/%m/%Y",
						showsTime : false,
						button : "calendar1", 
						step : 1
						});
				</script>
                                    </tr> 
                                   <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Transporte: $</span></td>
                                        <td>&nbsp;</td>
                                        <td><input type="text" name="param_transporte" id="param_transporte" class="text_grv" size="21" maxlength="20" value="<?php echo $data->param_transporte;?>"/></td>
                                    </tr>
                                     <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Contribuciones: $</span></td>
                                        <td>&nbsp;</td>
                                        <td><input type="text" name="param_contribuciones" id="param_contribuciones" class="text_grv" size="21" maxlength="20" value="<?php echo $data->param_contribuciones;?>"/></td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="top"><span class="lbl_gray">Descripcion:</span></td>
                                        <td>&nbsp;</td>
                                        <td><textarea name="param_description" id="param_description" class="text_grv" cols="40" rows="7"><?php echo $data->param_description;?></textarea></td>
                                    </tr> 
                                  	<tr>
                                        <td colspan="3" align="center">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" align="center">
                                         <input type="button" class="button_grv" value="Save" onclick="javascript: return validateParameter();" />
                                         
                                        <input type="button" class="button_grv" value="Cancel" onClick="javascript:window.history.back(-1);" />
                                        </td>
                                    </tr>
                                </table>
                </td>
            </tr>
        </table>
    </div>
</form>    
</body>
</html>
